<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
/*em和rem都是单位，它们都会随字体大小的改变而改变
1em = 1个元素字体大小（默认字体大小为16px）
1rem = 1个个元素字体大小*/
        .box{
            font-size: 16px;
            width: 10em;
    /*相当于：width:160px*/
            height:10em;
    /*相当于：height:160px*/
            background-color: skyblue;
        }

        html{
            font-size: 20px;
        }
        .box2{
            width: 10rem;
    /*相当于：width:200px*/
            height: 10rem;
    /*相当于：height:200px*/
            background-color: orange;
        }
    </style>
</head>
<body>
    <div class="box"></div>
    <div class="box2"></div>
</body>
</html>